package com.lianyu.wangyiyun.activity;

import android.content.Intent;
import android.os.Handler;
import android.os.Looper;

import com.bumptech.glide.Glide;
import com.lianyu.wangyiyun.R;
import com.lianyu.wangyiyun.databinding.ActivitySplashBinding;

/**
 * @author Chen Yuguang
 */
public class SplashActivity extends BaseActivity {

    @Override
    protected void initView() {
        ActivitySplashBinding activitySplashBinding = ActivitySplashBinding.inflate(getLayoutInflater());
        setContentView(activitySplashBinding.getRoot());
        Glide.with(this).asGif().load(R.drawable.rainy).into(activitySplashBinding.splashImage);
    }

    @Override
    protected void initEvent() {
        new Handler(Looper.myLooper()).postDelayed(() -> {
            startActivity(new Intent(SplashActivity.this, LoginActivity.class));
            finish();
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }, 3000);
    }

}